package com.bdqn.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.bdqn.model.ServiceType;
import com.bdqn.service.ServiceTypeSerivce;


@Controller
@RequestMapping("/serviceType")
public class ServiceTypeController {

	@Autowired
	private ServiceTypeSerivce serviceTypeService;
	
	@RequestMapping("/type")
	@ResponseBody
	public List<ServiceType> list(){
		
		
		List<ServiceType> st = new ArrayList<>();
		
		st = serviceTypeService.ListAll();
		
		for (ServiceType serviceType : st) {
			
			System.out.println(serviceType.getServiceType());
		}
		
		return st;
	}
}
